<template>
  <div>
    <h2>测试Vuex</h2>
    <h5>count:{{ count }}</h5>
    <button @click="countAdd">count++</button>
  </div>
</template>

<script setup lang="ts">
import store from '@/store'
import { ref } from 'vue'
const count = ref(0)
count.value = store.state.count
console.log(store.state.count)
const countAdd = () => {
  store.commit('add')
  count.value = store.state.count
}

</script>

<style>
</style>
